﻿@*
UNDERSTANDING THE TEMPLATE SEARCH ORDER

there is a very specific sequence that the MVC Framework follows to find a suitable template:
1. The template passed to the helper—for example, Html.EditorFor(m => m.SomeProperty, "MyTemplate") would lead to MyTemplate being used.
2. Any template that is specified by metadata attributes, such as UIHint.
3. The template associated with any data type specified by metadata, such as the DataType attribute.
4. Any template that corresponds to the.NET class name of the data type being processed.
5. The built-in String template if the data type being processed is a simple type.
6. Any template that corresponds to the base classes of the data type.
7. If the data type implements IEnumerable, then the built-in Collection template will be used.If all
else fails, the Object template will be used—subject to the rule that scaffolding is not recursive.
*@



@*
the MVC Framework looks for a template called EditorTemplates/<name> for
editor helper methods or DisplayTemplates/<name> for display helper methods
*@

@*
Custom templates are found using the same search pattern as regular views, which means we can create a
controller-specific custom template and place it in the ~/Views/<controller>/EditorTemplates folder to
override the templates found in the ~/Views/Shared folder. In Chapter 18, we explained more about the
way that views are located.
*@

@model HelperMethods.Models.Role
@Html.DropDownListFor(m => m, new SelectList(Enum.GetNames(Model.GetType()), Model.ToString()))